package com.laxia.exception;

import com.laxia.model.Result;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class BusinessException extends RuntimeException {

    private int code;
    private String message;

    public BusinessException(String message) {
        this(Result.DEFAULT_ERROR_CODE, message);
    }

    public BusinessException(int code, String message) {
        this(code, message, new Throwable());
    }

    public BusinessException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
